home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 13
/
AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso
/
rexx
/
cmdshell.bed
< prev
next >
Wrap
Text File
|
1997-12-03
|
1KB
|
83 lines
/*
** $VER: CmdShell.bed 1.0 (02.01.96)
**
** Run the BED command shell
**
** Modified by Marco Negri
*/
OPTIONS RESULTS
OPTIONS FAILAT 100
OPTIONS PROMPT "BED> "
SAY
SAY ' Enter a BED command or:'
SAY ' - Help <command>'
SAY ' - GetTemplate <command>'
SAY
DO FOREVER
PARSE PULL cmdString
SELECT
WHEN (cmdString = "") | (UPPER(cmdString) = "Q") | (UPPER(cmdString) = "QUIT") THEN DO
LEAVE
END
WHEN (cmdString = "?") THEN DO
SAY 'Enter "Help <command>" to obtain a command''s help'
SAY 'Enter "GetTemplate <command>" to obtain the command''s template'
SAY 'Enter CTRL-\ to close this window.'
END;
OTHERWISE DO
CALL HandleCmd(cmdString)
END;
END
END
RETURN
HandleCmd: PROCEDURE
PARSE ARG cmdString
cmdString
IF RC = 0 THEN DO
IF symbol('RESULT') == "VAR" THEN DO
SAY RESULT
END
RETURN
END;
IF BED.LASTERROR = 29 THEN DO
ADDRESS REXX cmdString
IF RC > 0 THEN DO
ADDRESS COMMAND cmdString
END
END
IF RC > 0 THEN DO
last = BED.LASTERROR
special = BED.SPECIALERROR
GetErrorInfo last
SAY '*** General Error #'last'; 'RESULT
IF special ~= 0 THEN DO
IF last = 36 THEN
msg = ERRORTEXT(special)
ELSE DO
GetErrorInfo last special
msg = RESULT
END
SAY '*** Special Error #'special'; 'msg
END
END
RETURN